package com.zhentao.product.controller;

import com.zhentao.nlz.project.dto.DetectionProcessDto;
import com.zhentao.nlz.project.dto.TDeptDto;
import com.zhentao.nlz.project.product.TDetectionProcess;
import com.zhentao.product.service.TDetectionProcessService;
import com.zhentao.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@RequestMapping("tDetectionProcess")
public class TDetectionProcessController {
    @Autowired
    private TDetectionProcessService tDetectionProcessService;
    @PostMapping("DetectionProcessList")
    public Result DetectionProcessList(DetectionProcessDto detectionProcessDto){
        System.err.println(detectionProcessDto);
        return Result.success(tDetectionProcessService.DetectionProcessList(detectionProcessDto));
    }
    @PostMapping("DetectionProcessAdd")
    private Result DetectionProcessAdd(TDetectionProcess detectionProcess){
        return tDetectionProcessService.DetectionProcessAdd(detectionProcess);
    }
    @PutMapping("DetectionProcessUpdate")
    private Result DetectionProcessUpdate(TDetectionProcess detectionProcess){
        System.err.println(detectionProcess);
        detectionProcess.setUpdateTime(new Date());
        return tDetectionProcessService.DetectionProcessUpdate(detectionProcess);
    }
    @DeleteMapping("DetectionProcessDelete")
    private Result DetectionProcessDelete(Integer id){
        return tDetectionProcessService.DetectionProcessDelete(id);
    }
}
